package com.epfresh.supplier.dialog;


import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.text.Html;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import com.epfresh.supplier.R;
import com.epfresh.supplier.entity.Goods;


public class HomePriceNoticeDialog extends Dialog {

    private TextView tvSure,tv_content;
    String goods;

    public HomePriceNoticeDialog(Context context) {
        super(context, R.style.PosDialog);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_price_home);

        //初始化界面控件
        initView();
        //初始化界面控件的事件
        initEvent();

    }

    /**
     * 初始化界面的确定和取消监听器
     */
    private void initEvent() {

    }

    /**
     * 初始化界面控件
     */
    private void initView() {

        tv_content = (TextView)findViewById(R.id.tv_content);
        tvSure = (TextView) findViewById(R.id.tv_sure);

        tvSure.setOnClickListener(onClickListener);

        findViewById(R.id.iv_cancel).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });

    }

    View.OnClickListener onClickListener = new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            if (onSureListener != null) {
                onSureListener.onClick(v);
            }
        }
    };


    View.OnClickListener onSureListener;

    public View.OnClickListener getOnSureListener() {
        return onSureListener;
    }

    public void setOnSureListener(View.OnClickListener onSureListener) {
        this.onSureListener = onSureListener;
    }

    public void show(String goods) {
        super.show();
        tv_content.setText(Html.fromHtml(goods));
    }
}
